// 使用制度;
// 使用System.Collections.Generic;
// 使用System.Diagnostics;
// 使用System.Numerics;
// 使用System.Runtime.CompilerServices;
// 使用System.Text;
// 使用BepuPhysical;
// 使用BepuPhysics.Collidables;
// 使用BepuPhysics.CollisionDetect;
// 使用BepuPhysics.CollisionDetection.CollisionTasks;
// 使用BepuPhysics.CollisionDetection.SweepTasks;
// 使用BepuUtilities;
// 使用BepuUtility。集合;
// 使用BepuUtility：Memory;
// 使用DemoContentLoader;
// 使用DemoRenender;
// 使用DemoRenderer.Constraints;
// 使用DemoRenderer.UI;
// 使用演示实用程序;
// Using Quaternion=BepuUtility(使用四元数=BepuUtility)四元数;

// 命名空间Demos.SpecializedTests
// {
// //这依赖于生成的DepthRefiner,文本模板中的debug标志设置为true。
// 公共类DepthRefinerTestDemo：demo
// {
// 缓冲区<LineInstance>shapeLines;
// 列出<DepthRefinerStep>步骤;
// 向量3基位;

// 公共不安全覆盖无效初始化(内容存档内容,摄像机)
// {
// camera.Position=新矢量3(0,0,13f);
// 摄像机。偏航=0;
// Camera.Pitch=0;
// Simulation=Simulation.Create(BufferPool,new DemoNarrowPhaseCallback(),new DemoPoseIntegratorCallback(new Vector3(0,0,0);
// //{
// /var shapeA=新圆柱体(1f,2f);
// /var posea=new RigidPose(new Vector3(12,0.5F,12),Quaternion.CreateFromAxisangle(new Vector3(1,0,0),MathF.PI*0.5F));
// /var shapeB=new triangle(new Vector3(-2f,0,-2f),new Vector3(2f,0,-2f),new Vector3(-2f,0,2f));
// /var poseB=new RigidPose(new Vector 3(12,0,12));
// //var shapeA=新圆柱体(0.4F,0.09F);
// /var posea=new RigidPose(new Vector3(12,0.5F,12),Quaternion.CreateFromAxisangle(new Vector3(1,0,0),MathF.PI*0.5F));
// //var shapeB=new三角形(new Vector3(-0.104847f,-2.863911f,-0.8221359f),new Vector3(-0.7841263f,1.040714f,-1.362942f),new Vector3(0.8889847f,1.823196f,2.185074f));
// /var poseB=new RigidPose(new Vector 3(12,0,12));
// //Matrix3x3宽localOrientationB;
// //Vector3Wide.Broadcast(new Vector3(-0.4182778f,-0.1956204f,-0.887004f),out localOrientationB.x);
// //Vector3Wide.Broadcast(new Vector3(-0.8923031f,-0.09407896f,0.4415249f),out localOrientationB.Y);
// //Vector3Wide.Broadcast(new Vector3(-0.1698197f,0.9761565f,-0.1352016f),out localOrientationB.Z);
// //Vector3Wide.Broadcast(new Vector3(0.3561249f,2.797102f,0.4073029f),out var localOffsetB);

// //Vector3Wide.Normalize(localOffsetB,out var initialNormal);
// /Vector3Wide.Broadcast(new Vector3(0.9673051f,0.07194486f,-0.2431969f),out var initialNormal);
// /var initialDepth=new Vector<Float>(0.007193089f);

// //var ConvergenceThreshold=new Vector<Float>(4e-7f);

// //var minimumDepthThreshold=new Vector<Float>(-0.1F);

// /var simplex=new DepthRefiner<柱面、柱面宽、柱面支持查找器、三角形、三角面宽、PretransformedTriangleSupportFinder>.SimplexWithWitness();
// /Vector3Wide.Broadcast(new Vector3(-0.05699956f,-0.4314917f,0.445577f),out simplex.A.Support);
// /Vector3Wide.Broadcast(new Vector3(-0.3718189f,-0.09f,0.1474812f),out simplex.A.SupportOnA);
// /simplex.A.Exists=new Vector<int>(-1);

// /Vector3Wide.Broadcast(new Vector3(0.3148193f,-0.4314917f,0.2980957f),out simplex.B.Support);
// /Vector3Wide.Broadcast(new Vector3(0f,-0.09F,0f),out simplex.B.SupportOnA);
// /simplex.B.Exists=new Vector<int>(-1);

// /Vector3Wide.Broadcast(new Vector3(-1.175686f,3.316494f,0.7135266f),out simplex.C.Support);
// /Vector3Wide.Broadcast(new Vector3(-0.2811551f,-0.09f,-0.2845203f),out simplex.C.SupportOnA);
// /simplex.C.Exists=new Vector<int>(-1);

// //basePosition=默认值;
// //var posea=RigidPose.Identity;
// //Matrix3x3Wide.ReadSlot(ref localOrientationB,0,out var OrientationB Narrow);
// //RigidPose poseB;
// //Quaternion.CreateFromRotationMatrix(orientationBNarrow,Out poseB.Orientation);
// //向量3Wide.ReadSlot(ref localOffsetB,0,out poseB.Position);
// //ShapeLines=MinkowskiShapeVisualizer.CreateLines<Cylinder,柱面宽,柱面支持查找器,三角形,三角形宽,预转换三角形支持查找器>(
// //shapeA,shapeB,posea,poseB,65536,
// //0.01f,新Vector3(0.4F,0.4F,0),
// //0.1F,new Vector3(0,1,0),default,basePosition,BufferPool);

// //var awide=default(CylinderWide);
// //var bWide=default(TriangleWide);
// //aWide.Broadcast(ShapeA);
// //bWide.Broadcast(ShapeB);
// /var worldOffsetB=poseB.Position-poseA.Position;
// /var localOrientationB=Matrix3x3.CreateFromQuaternion(Quaternion.Concatenate(poseB.Orientation,四元数.共轭(poseA.Orientation);
// /var localOffsetB=Quaternion.Transform(worldOffsetB,Quaternion.Conjugate(poseA.Orientation));
// /Vector3Wide.Broadcast(localOffsetB,out var localOffsetBWide);
// /Matrix3x3Wide.Broadcast(localOrientationB,out var localOrientationBWide);
// //var triangleSupportFinder=default(PretransformedTriangleSupportFinder);
// //var CylinderSupportFinder=default(CylinderSupportFinder);

// /var initialNormal=Vector3.Normalize(LocalOffsetB);
// /Vector3Wide.Broadcast(initialNormal,out var initialNormalWide);
// //step=new list<DepthRefinerStep>();
// /深度精简器<柱面、柱面宽、柱面支持查找器、三角形、三角面宽、PretransformedTriangleSupportFinder>.FindMinimumDepth(
// /awide,bWide,localOffsetB,localOrientationB,ref linderSupportFinder,ref triangleSupportFinder,ref simplex,initialNormal,initialDepth,new Vector<int>(),ConvergenceThreshold,minumDepthThreshold,
// /OUT VAR DepthWide,Out var localNormalWide,OUT VAR WORWESSONA,STEPS,50);
// //深度细化<柱面、柱面宽、柱面支持查找器、三角形、三角面宽、PretransformedTriangleSupportFinder>.FindMinimumDepth(
// //awide,bWide,localOffsetB,localOrientationB,ref CylinderSupportFinder,ref triangleSupportFinder,initialNormal,new Vector<int>(),ConvergenceThreshold,minumDepthThreshold,
// //OUT VAR DepthWide,Out var localNormalWide,OUT VAR WORCESSONA,STEPS,50);

// //}

// {
// const int pointCount=16;
// var随机化点=新快速列表<向量3>(pointCount*2,BufferPool);
// VaR随机=新随机(5);
// for(int i=0;i<pointCount;++i)
// {
// AnswizedPoints.AllocateUnsafe()=new Vector3(33*(浮点)随机.NextDouble(),1*(浮点)随机.NextDouble(),13*(浮点)随机.NextDouble());
// }
// var shapeA=新的ConvexHull(randomizedPoints.Span.Slice(randomizedPoints.Count),缓冲池,输出var hullCenter);
// //var posea=new RigidPose(new Vector3(12,0.5F,12),Quaternion.CreateFromAxisangle(new Vector3(1,0,0),MathF.PI*0.5F));
// var shapeB=新三角形(
// 新矢量3(7.499722f,-8.201822f,-23.06599f),
// 新矢量3(1.648121f,-28.36107f,31.33404f),
// 新矢量3(-9.147846f,36.56289f,-8.268051f);

// //var poseB=new RigidPose(new Vector 3(12,0,12));
// 矩阵3x3宽定位B;
// Vector3Wide.Broadcast(new Vector3(0.3963324f,-0.1519237f,0.90545f),out localOrientationB.X);
// Vector3Wide.Broadcast(new Vector3(-0.3329513f,0.8952942f,0.2959588f),out localOrientationB.Y);
// Vector3Wide.Broadcast(new Vector3(-0.8556075f,-0.4187689f,0.304251f),out localOrientationB.Z);
// var localOffsetBNarrow=新矢量3(7.41188f,-34.41978f,7.493548f);
// Vector3Wide.Broadcast(localOffsetBNarrow,out var localOffsetB);

// //Vector3Wide.Normalize(localOffsetB,out var initialNormal);
// Vector3Wide.Broadcast(new Vector3(1f,0,0),out var initialNormal);
// var initialDepth=new Vector<Float>(2.674457f);

// var ConvergenceThreshold=new Vector<Float>(1e-5f*4.187582f);

// var minum DepthThreshold=new Vector<Float>(-1f);

// basePosition=默认值;
// var posea=RigidPose.Identity;
// Matrix3x3Wide.ReadSlot(ref localOrientationB,0,out var OrientationB Narrow);
// RigidPose poseB;
// Quaternion.CreateFromRotationMatrix(orientationBNarrow,Out poseB.Orientation);
// 向量3Wide.ReadSlot(ref localOffsetB,0,out poseB.Position);
// ShapeLines=MinkowskiShapeVisualizer.CreateLines<ConvexHull,凸空宽、凸空支持查找器、三角形、三角形宽、预转换三角支持查找器>(
// 形状A,形状B,位置A,位置B,65536,
// 0.01f,新矢量3(0.4f,0.4f,0),
// 0.1F,new Vector3(0,1,0),default,basePosition,BufferPool);

// var awide=默认值(ConvexHullWide);
// var memory yLength=Unsafe.SizeOf<ConvexHull>()*Vector<Float>.Count;
// VAR MEMORY=堆栈分配字节[Memory Length];
// aWide.Initialize(new RawBuffer(memory,memyLength));
// var bWide=默认值(TriangleWide);
// aWide.Broadcast(ShapeA);
// bWide.Broadcast(ShapeB);
// //var worldOffsetB=poseB.Position-poseA.Position;
// //var localOrientationB=Matrix3x3.CreateFromQuaternion(Quaternion.Concatenate(poseB.Orientation,四元数.共轭(poseA.Orientation);
// //var localOffsetB=Quaternion.Transform(worldOffsetB,Quaternion.Conjugate(poseA.Orientation));
// //Vector3Wide.Broadcast(localOffsetB,out var localOffsetBWide);
// //Matrix3x3Wide.Broadcast(localOrientationB,out var localOrientationBWide);
// var triangleSupportFinder=默认值(PretransformedTriangleSupportFinder);
// var vvexHullSupportFinder=默认值(ConvexHullSupportFinder);


// DepthRefiner<凸壳、凸壳宽、凸壳支持查找器、三角形、三角宽、PretransformedTriangleSupportFinder>.SimplexWithWitness单工=默认;
// Vector3Wide.Broadcast(新Vector3(19.4402f,-1.873452f,1.636454f),out simplex.A.支持);
// Vector3Wide.Broadcast(new Vector3(17.70424f,0.2696521f,0.8619514f),out simplex.A.SupportOnA);
// simplex.A.Exists=new Vector<int>(-1);
// Vector3Wide.Broadcast(新Vector3(-20.94802f,34.62053f,-9.692917f),out simplex.b.支持);
// Vector3Wide.Broadcast(new Vector3(-13.53614f,0.2007419f,-2.199368f),out simplex.B.SupportOnA);
// simplex.B.Exists=new Vector<int>(-1);
// Vector3Wide.Broadcast(新Vector3(-28.44774f,42.82235f,13.37307f),out simplex.C.支持);
// Vector3Wide.Broadcast(new Vector3(-13.53614f,0.2007419f,-2.199368f),out simplex.C.SupportOnA);
// simplex.C.Exists=new Vector<int>(-1);

// //Vector3Wide.Broadcast(new Vector3(-28.44774f,42.82235f,13.37307f),out simplex.A.Support);
// //Vector3Wide.Broadcast(new Vector3(-13.53614f,0.2007419f,-2.199368f),out simplex.A.SupportOnA);
// //simplex.A.Exists=new Vector<int>(-1);

// //var initialNormal=Vector3.Normalize(LocalOffsetB);
// //Vector3Wide.Broadcast(initialNormal,out var initialNormalWide);
// Steps=new list<DepthRefinerStep>();
// //深度细化<柱面、柱面宽、柱面支持查找器、三角形、三角面宽、PretransformedTriangleSupportFinder>.FindMinimumDepth(
// //awide,bWide,localOffsetB,localOrientationB,ref CylinderSupportFinder,ref triangleSupportFinder,ref simplex,initialNormal,initialDepth,new Vector<int>(),ConvergenceThreshold,minumDepthThreshold,
// //OUT VAR DepthWide,Out var localNormalWide,OUT VAR WORCESSONA,STEPS,50);
// var inactiveLanes=新矢量<int>(-1);
// 不安全。As<Vector<int>,int>(Ref InactiveLanes)=0;
// //DepthRefiner<ConvexHull,ConvexHullWide,ConvexHullSupportFinder,Triangle,TriangleWide,PretransformedTriangleSupportFinder>.FindMinimumDepth(
// //awide,bWide,localOffsetB,localOrientationB,ref vulexHullSupportFinder,ref triangleSupportFinder,ref simplex,initialNormal,initialDepth,inactiveLanes,ConvergenceThreshold,minumDepthThreshold,
// //OUT VAR DepthWide,Out var localNormalWide,OUT VAR WORCESSONA,STEPS,50);


// //Vector3Wide.Broadcast(new Vector3(0,-1,0),out initialNormal);
// 深度精简器<凸包,凸包宽,凸包支持查找器,三角形,三角形宽,PretransformedTriangleSupportFinder>.FindMinimumDepth(
// Awide,bWide,localOffsetB,localOrientationB,ref vumexHullSupportFinder,ref triangleSupportFinder,initialNormal,inactiveLanes,ConvergenceThreshold,minumDepthThreshold,
// 输出变量深度宽度,输出变量局部正常宽度,输出变量目击者On A,步骤,50);


// Simulation.Statics.Add(new StaticDescription(poseA.Position+new Vector 3(50,0,0),poseA.Orientation,new CollidableDescription(Simulation.Shapes.Add(shapeA),0.1F));
// Simulation.Statics.Add(new StaticDescription(localOffsetBNarrow+new Vector 3(50,0,0),Quaterni.Identity,new CollidableDescription(Simulation.Shapes.Add(shapeB),0.1F));
// }

// //{
// //var shapeA=新胶囊(0.5f,1f);
// //var posea=new RigidPose(new Vector 3(0,0,0),Quaternion.Identity);
// //var poseB=new RigidPose(new Vector3(-0.75f,1.1f,0),Quaternion.CreateFromAxisangle(Vector3.UnitZ,0.2F));

// //var points=new QuickList<Vector3>(8,BufferPool);
// //points.Allocate(BufferPool)=new Vector3(0,0,0);
// //points.Allocate(BufferPool)=new Vector3(0,0,1);
// //points.Allocate(BufferPool)=new Vector3(0,1,0);
// //points.Allocate(BufferPool)=new Vector3(0,1,1);
// //points.Allocate(BufferPool)=new Vector3(1,0,0);
// //points.Allocate(BufferPool)=new Vector3(1,0,1);
// //points.Allocate(BufferPool)=new Vector3(1,1,0);
// //points.Allocate(BufferPool)=new Vector3(1,1,1);

// //ConvexHullHelper.CreateShape(points.Span.Slice(0,points.Count),BufferPool,Out_,out var shapeB);

// //basePosition=默认值;
// /shapeLines=Minkowski ShapeVisualizer.CreateLines<Capsulm,CapsuleWide,CapsuleSupportFinder,ConvexHull,ConvexHullWide,ConvexHullSupportFinder>(
// /shapeA,shapeB,posea,poseB,65536,
// /0.01f,新矢量3(0.4f,0.4f,0),
// /0.1F,new Vector3(0,1,0),default,basePosition,BufferPool);
// //ShapeLines=MinkowskiShapeVisualizer.CreateLines<ConvexHull,ConvexHullWide、ConvexHullSupportFinder、CapsuleHullSupportFinder、CapsuleWide、CapsuleSupportFinder>(
// //shapeB,shapeA,poseB,posea,65536,
// //0.01f,新Vector3(0.4F,0.4F,0),
// //0.1F,new Vector3(0,1,0),default,basePosition,BufferPool);

// //var awide=default(CapsuleWide);
// //var bWide=default(ConvexHullWide);
// //aWide.Broadcast(ShapeA);
// //BufferPool.Take(bWide.InternalAllocationSize,out var memory);
// //bWide.Initialize(memory y.Slice(0,bWide.InternalAllocationSize));
// //bWide.Broadcast(ShapeB);
// //var worldOffsetB=poseB.Position-poseA.Position;
// //var localOrientationB=Matrix3x3.CreateFromQuaternion(Quaternion.Concatenate(poseB.Orientation,四元数.共轭(poseA.Orientation);
// //var localOffsetB=Quaternion.Transform(worldOffsetB,Quaternion.Conjugate(poseA.Orientation));
// //Vector3Wide.Broadcast(localOffsetB,out var localOffsetBWide);
// //Matrix3x3Wide.Broadcast(localOrientationB,out var localOrientationBWide);
// //var supportFinderA=default(CapsuleSupportFinder);
// //var supportFinderB=default(ConvexHullSupportFinder);

// //var initialNormal=Vector3.Normalize(LocalOffsetB);
// //Vector3Wide.Broadcast(initialNormal,out var initialNormalWide);
// //step=new list<DepthRefinerStep>();
// //DepthRefiner<封装,CapsuleWide,CapsuleSupportFinder,ConvexHull,ConvexHullWide,ConvexHullSupportFinder>.FindMinimumDepth(
// //awide,bWide,localOffsetBWide,localOrientationBWide,ref supportFinderA,ref supportFinderB,initialNormalWide,new Vector(),new Vector(1e-6f),new Vector(-500),
// //out var Deep thWide1,out var localNormalWide1,step,50);

// //steps.clear();
// //var worldOffsetA=poseA.Position-poseB.Position;
// //var localOrientationA=Matrix3x3.CreateFromQuaternion(Quaternion.Concatenate(poseA.Orientation,四元数.共轭(poseB.Orientation);
// //var localOffsetA=Quaternion.Transform(worldOffsetA,Quaternion.Conjugate(poseB.Orientation));
// //Vector3Wide.Broadcast(localOffsetA,out var localOffsetAWide);
// //Matrix3x3Wide.Broadcast(localOrientationA,out var localOrientationAWide);
// //Vector3Wide.Broadcast(Vector3.Normalize(localOffsetA),Out var initialNormalWide2);
// //DepthRefiner<ConvexHull,ConvexHullWide,ConvexHullSupportFinder,CapsuleWide,CapsuleSupportFinder>.FindMinimumDepth(
// //bWide,awide,localOffsetAWide,localOrientationAWide,ref supportFinderB,ref supportFinderA,initialNormalWide2,new Vector(),new Vector(1e-6f),new Vector(-500),
// //out var Deep thWide2,out var localNormalWide2,step,50);

// //poseA.Position.Z-=2;
// //poseB.Position.Z-=2;
// //Simulation.Bodies.Add(BodyDescription.CreateDynamic(poseA,默认,新CollidableDescription(Simulation.Shapes.Add(shapeA),0.1F),默认));
// //Simulation.Bodies.Add(BodyDescription.CreateDynamic(poseB,new BodyInertia{逆质量=1},new CollidableDescription(Simulation.Shapes.Add(shapeB),0.1F),默认));

// //}


// //{
// //var shapeA=新圆柱体(0.5f,1f);
// //var posea=new RigidPose(new Vector 3(0,0,0));
// //var shapeB=新圆柱体(1f,2f);
// /var position B=new Vector3(-0.2570486f,0.780561f,-1.033215f);
// /var position B=new Vector3(-0.2570486f,5.780561f,-1.033215f);
// /var position B=new Vector3(-1.0570486f,-.380561f,1.0833215f);
// //var position B=new Vector3(-1.5570486f,-.580561f,.033215f);
// //var localOrientationBMatrix=new Matrix3x3
// //{
// //X=新矢量3(0.9756086f,0.1946615f,0.101463f),
// //Y=新矢量3(-0.1539477f,0.9362175f,-0.3159063f),
// //Z=新矢量3(-0.1564862f,0.2925809f,0.9433496f)
// //};
// /var position B=new Vector3(-1.437585f,0.386236f,-1.124907f);
// /var position B=新矢量3(.1037585f,1.568576f,.124907f);
// /var position B=new Vector3(1.037585f,.7568576f,0.90424907f);
// /var position B=new Vector3(4.037585f,2.7568576f,2.90424907f);
// /var position B=new Vector3(3.037585f,1.7568576f,1.90424907f);
// /var localOrientationBMatrix=new Matrix3x3
// /{
// /X=新矢量3(-0.7615921f,0.001486331f,-0.648055f),
// /Y=新矢量3(0.6341797f,0.2075436f,-0.7448099f),
// /Z=新矢量3(-0.1333926f,-0.9782246f,-0.1590062f)
// /};
// /var poseB=new RigidPose(new Vector3(-0.2570486f,1.780561f,-1.033215f),Quaternion.CreateFromAxisAngle(Vector3.Normalize(new Vector3(1,1,1)),MathF.PI*0.35f);
// //var位置B=新的刚体(位置B,Quaternion.CreateFromRotationMatrix(localOrientationBMatrix));

// //basePosition=默认值;
// //ShapeLines=MinkowskiShapeVisualizer.CreateLines<Cylinder,柱面宽度,柱面支持查找程序,柱面,柱面宽度,柱面支持查找程序>(
// //shapeA,shapeB,posea,poseB,65536,
// //0.01f,新Vector3(0.4F,0.4F,0),
// //0.1F,new Vector3(0,1,0),default,basePosition,BufferPool);

// //var awide=default(CylinderWide);
// //var bWide=默认值(CylinderWide);
// //aWide.Broadcast(ShapeA);
// //bWide.Broadcast(ShapeB);
// //var worldOffsetB=poseB.Position-poseA.Position;
// //var localOrientationB=Matrix3x3.CreateFromQuaternion(Quaternion.Concatenate(poseB.Orientation,四元数.共轭(poseA.Orientation);
// //var localOffsetB=Quaternion.Transform(worldOffsetB,Quaternion.Conjugate(poseA.Orientation));
// //Vector3Wide.Broadcast(localOffsetB,out var localOffsetBWide);
// //Matrix3x3Wide.Broadcast(localOrientationB,out var localOrientationBWide);
// //var supportFinder=default(CylinderSupportFinder);

// //var initialNormal=Vector3.Normalize(LocalOffsetB);
// //Vector3Wide.Broadcast(initialNormal,out var initialNormalWide);
// //step=new list<DepthRefinerStep>();
// //DepthRefiner<CylinderWide,CylinderSupportFinder,CylinderWide,CylinderSupportFinder>.FindMinimumDepth(
// //awide,bWide,localOffsetBWide,localOrientationBWide,ref supportFinder,ref supportFinder,initialNormalWide,new Vector(),new Vector(1e-6f),new Vector(-500),
// //out var epepthWide,out var localNormalWide,step,50);

// //const int iterationCount=100000;
// //Double minTime=double.MaxValue;
// //for(int j=0;j<10;++j)
// //{
// //var start=Stopwatch.GetTimestamp();
// //for(int i=0;i<iterationCount;++i)
// //{
// //DepthRefiner<CylinderWide,CylinderSupportFinder,CylinderWide,CylinderSupportFinder>.FindMinimumDepth(
// //awide,bWide,localOffsetBWide,localOrientationBWide,ref supportFinder,ref supportFinder,initialNormalWide,new Vector(),new Vector(1e-6f),new Vector(-500),
// //out var Deep thWide2,out var localNormalWide2,null,50);
// //}
// //var stop=Stopwatch.GetTimestamp();
// //var span=(stop-start)*1e9f/(iterationCount*(Double)Stopwatch.Frequency);
// //Console.WriteLine($"time{j}(Ns)：{span}");
// //minTime=Math.Min(span,minTime);
// //}
// //Console.WriteLine($"最佳时间柱面(Ns)：{minTime}");
// //}

// //Console.WriteLine();
// //{
// //var shapeA=new Box(1f,1f,1f);
// //var posea=new RigidPose(new Vector 3(0,0,0));
// //var shapeB=new Box(1f,1f,1f);
// //var poseB=new RigidPose(new Vector3(-.9f,-0.8f,0.7f),Quaternion.CreateFromAxisAngle(Vector3.Normalize(new Vector3(1,1,1)),MathHelper.PiOver2);

// //basePosition=默认值;
// //shapeLines=Minkowski ShapeVisualizer.CreateLines<Box,BoxWide,BoxSupportFinder,Box,BoxWide,BoxSupportFinder>(
// //shapeA,shapeB,posea,poseB,65536,
// //0.01f,新Vector3(0.4F,0.4F,0),
// //0.1F,new Vector3(0,1,0),default,basePosition,BufferPool);

// //var awide=default(BoxWide);
// //var bWide=default(BoxWide);
// //aWide.Broadcast(ShapeA);
// //bWide.Broadcast(ShapeB);
// //var worldOffsetB=poseB.Position-poseA.Position;
// //var localOrientationB=Matrix3x3.CreateFromQuaternion(Quaternion.Concatenate(poseB.Orientation,四元数.共轭(poseA.Orientation);
// //var localOffsetB=Quaternion.Transform(worldOffsetB,Quaternion.Conjugate(poseA.Orientation));
// //Vector3Wide.Broadcast(localOffsetB,out var localOffsetBWide);
// //Matrix3x3Wide.Broadcast(localOrientationB,out var localOrientationBWide);
// //var supportFinder=default(BoxSupportFinder);

// //var initialNormal=Vector3.Normalize(LocalOffsetB);
// //Vector3Wide.Broadcast(initialNormal,out var initialNormalWide);
// //step=new list<DepthRefinerStep>();
// //DepthRefiner<Box,BoxWide,BoxSupportFinder,Box,BoxWide,BoxSupportFinder>.FindMinimumDepth(
// //awide,bWide,localOffsetBWide,localOrientationBWide,ref supportFinder,ref supportFinder,initialNormalWide,new Vector(),new Vector(1e-6f),new Vector(-500),
// //out var epepthWide,out var localNormalWide,step,50);

// //const int iterationCount=100000;
// //Double minTime=double.MaxValue;
// //for(int j=0;j<10;++j)
// //{
// //var start=Stopwatch.GetTimestamp();
// //for(int i=0;i<iterationCount;++i)
// //{
// //DepthRefiner<Box,BoxWide,BoxSupportFinder,Box,BoxWide,BoxSupportFinder>.FindMinimumDepth(
// //awide,bWide,localOffsetBWide,localOrientationBWide,ref supportFinder,ref supportFinder,initialNormalWide,new Vector(),new Vector(1e-6f),new Vector(-500),
// //out var Deep thWide2,out var localNormalWide2,null,50);
// //}
// //var stop=Stopwatch.GetTimestamp();
// //var span=(stop-start)*1e9f/(iterationCount*(Double)Stopwatch.Frequency);
// //Console.WriteLine($"time{j}(Ns)：{span}");
// //minTime=Math.Min(span,minTime);
// //}
// //Console.WriteLine($"最佳时间盒(Ns)：{minTime}");
// //}

// }

// INT STEP索引;
// 公共覆盖无效更新(窗口窗口、摄像机、输入输入、浮动DT)
// {
// IF(input.TypedCharacters.Contains(‘x’))
// {
// stepIndex=Math.Max(0,stepIndex-1);
// }
// Else If(input.TypedCharacters.Contains(‘c’))
// {
// stepIndex=Math.Min(stepIndex+1,steps.Count-1);
// }
// base.update(Window,Camera,Input,DT);
// }

// 公共覆盖空渲染(渲染器渲染器、摄影机、输入、TextBuilder文本、字体)
// {
// Minkowski ShapeVisualizer.Draw(shapeLines,渲染器);
// renderer.TextBatcher.Write(
// text.Clear().Append($"使用X和C枚举步骤：").Append(stepIndex+1).Append("Out").Append(steps.Count),
// new Vector 2(32,renderer.Surface.Resolution.Y-140),20,new Vector 3(1),font);
// var step=步骤[stepIndex];
// renderer.TextBatcher.Write(
// text.Clear().Append($"下一个正常源：").Append(step.NextNormalSource.ToString()),
// new Vector 2(32,renderer.Surface.Resolution.Y-120),20,new Vector 3(1),font);
// renderer.TextBatcher.Write(
// text.Clear().Append($"最佳深度：").Append(step.BestDepth,9),
// new Vector 2(32,renderer.Surface.Resolution.Y-100),20,new Vector 3(1),font);

// IF(Step.A.Exists)
// {
// IF(Step.B.Exists)
// renderer.Lines.Allocate()=new LineInstance(step.A.Support+basePosition,step.B.Support+basePosition,new Vector3(0,0.6f,0.1f),default);
// //renderer.Lines.Allocate()=new LineInstance(basePosition,step.A.Support+basePosition,new Vector3(0,0,0.5F),默认值);
// }

// IF(Step.B.Exists)
// {
// IF(Step.C.Exists)
// renderer.Lines.Allocate()=new LineInstance(step.B.Support+basePosition,step.C.Support+basePosition,new Vector3(0,0.6f,0.1f),default);
// //renderer.Lines.Allocate()=new LineInstance(step.B.Support+basePosition,basePosition,new Vector3(0,0,0.5F),默认值);
// }

// IF(Step.C.Exists)
// {
// IF(Step.A.Exists)
// renderer.Lines.Allocate()=new LineInstance(step.C.Support+basePosition,step.A.Support+basePosition,new Vector3(0,0.6f,0.1f),default);
// //renderer.Lines.Allocate()=new LineInstance(step.C.Support+basePosition,basePosition,new Vector3(0,0,0.5F),默认值);
// }

// IF(Step.D.Exists)
// {
// IF(Step.A.Exists)
// renderer.Lines.Allocate()=new LineInstance(step.A.Support+basePosition,step.D.Support+basePosition,new Vector3(1,0.6f,0.1f),default);
// IF(Step.B.Exists)
// renderer.Lines.Allocate()=new LineInstance(step.B.Support+basePosition,step.D.Support+basePosition,new Vector3(1,0.6f,0.1f),default);
// IF(Step.C.Exists)
// renderer.Lines.Allocate()=new LineInstance(step.C.Support+basePosition,step.D.Support+basePosition,new Vector3(1,0.6f,0.1f),default);
// //renderer.Lines.Allocate()=new LineInstance(step.D.Support+basePosition,basePosition,new Vector3(0,0,0.5F),默认值);
// }

// IF(step.BestDepth>=0)
// renderer.Lines.Allocate()=new LineInstance(basePosition,basePosition+step.SearchTarget,new Vector3(1,0,0),default);
// 其他
// {
// ContactLines.BuildOrthnormalBasis(step.BestNormal,out var x,out var y);

// renderer.Lines.Allocate()=new LineInstance(basePosition,basePosition+step.BestNormal,new Vector3(1,0,0),default);
// render.Lines.Allocate()=new LineInstance(basePosition+step.BestNormal*step.BestDepth,basePosition+x*0.1F+step.BestNormal*step.BestDepth,new Vector3(1,1,0),default);
// }
// render.Lines.Allocate()=new LineInstance(basePosition+step.ClosestPointOnTriangle,basePosition+step.SearchTarget,new Vector3(0.5F,0,0),default);
// renderer.Lines.Allocate()=new LineInstance(basePosition,basePosition+step.NextNormal,new Vector3(1,0,1),default);


// base.Render(渲染器,摄像头,输入,文本,字体);
// }
// }
// }
